package com.example.lib.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

public class ProxyTest {

    public static void main(String[] args) {
        final Car car = new Car();
        InvocationHandler handler = new TimeHandler(car);
        try {
            Moveable m = (Moveable) Proxy.newProxyInstance(car.getClass().getClassLoader(), car.getClass().getInterfaces(), handler);
            m.move();
        } catch (Exception e) {

        }

    }
}
